<template>
<el-select
    v-model="activePage"
    :placeholder="$t('common.please_select')"
    class="percent-w100"
    @change="changeFunc"
    value-key="url"
  >
    <el-option
      v-for="item in pages"
      :key="item.url"
      :value-key="item.name"
      :label="item.name"
      :value="item"
    ></el-option>
  </el-select>
</template>

<script>
export default {
  data() {
    return {
      /*页面数据*/
      pages: [{
        url: "pages/index/index",
        name: $t("common.home"),
        type: $t("common.page")
      }, {
        url: "pages/product/category",
        name: $t("common.category"),
        type: $t("common.page")
      }, {
        url: "pages/article/list/list",
        name: $t("common.article_home"),
        type: $t("common.page")
      }, {
        url: "pages/cart/cart",
        name: $t("common.cart"),
        type: $t("common.page")
      }, {
        url: "pages/order/myorder",
        name: $t("common.order"),
        type: $t("common.page")
      }, {
        url: "pages/user/index/index",
        name: $t("common.mine"),
        type: $t("common.page")
      }, {
        url: "pages/shop/shopList",
        name: $t("common.store"),
        type: $t("common.page")
      }, {
        url: "pages/user/evaluate/list",
        name: $t("common.my_reviews"),
        type: $t("common.page")
      }, {
        url: "pages/user/notice/index",
        name: $t("common.my_messages"),
        type: $t("common.page")
      }
      // ,
      // {
      //   url: 'pages/code/code',
      //   name: '提货页面',
      //   type: '页面'
      // },
      // {
      //   url: 'pages/order/codeorder',
      //   name: '提货订单',
      //   type: '页面'
      // }
      ],
      /*选中的值*/
      activePage: $t("common.home")
    };
  },
  created() {
    /*初始化*/
    this.changeFunc(this.pages[0]);
  },
  methods: {
    /*选中的值*/
    changeFunc(e) {
      this.$emit("changeData", e);
    }
  }
};
</script>

